Learning notes

2025-07-28

Viewport

screen.width and screen.height return the width and height of the screen in pixels, including the taskbar and other UI elements. Zoom will change how each pixel is rendered and the screen width and height will change accordingly. If zoom is set to 100%, screen.width and screen.height will return the actual pixel dimensions of the screen. Otherwise, they will return the dimensions of the screen in CSS pixels, which may be different from the actual pixel dimensions due to zooming.


Reference

Viewport